#include <opencv/cv.h>
#include "Arbre.hpp"
#include <opencv/highgui.h>
#include <iostream>
#include <cstdlib>
#include <time.h>
using namespace std;

int main()
{
	IplImage *img; 
   srand(time(NULL));
    img=cvLoadImage("test.pgm");
		Image img2(img);

		Arbre a = Arbre(img2);
		a.split();
		//a.afficheMaillage(img);
		a.merge();
	a.afficheRegion(cvGetSize(img));
    cvNamedWindow("test", CV_WINDOW_AUTOSIZE);
    cvShowImage("test", img);
    cvDestroyWindow("test");
    cvReleaseImage(&img);

    img2.detruireImage();
    return 0;
}